package ch12;

class ThreadEx14 {
	public static void main(String args[]) {
		MyThreadEx23 t1 = new MyThreadEx23();
		MyThreadEx23 t2 = new MyThreadEx23();

		t1.start();
		t2.start();
	}
}

class MyThreadEx23 extends Thread {
	int iv = 0;

	public void run() {
		int lv = 0;

		while (lv < 3) {
			System.out.println(getName() + " Local Var:" + ++lv);
			System.out.println(getName() + " Instance Var:" + ++iv);
			System.out.println();
		}
	}
}
/*
Thread-1 Local Var:1
Thread-0 Local Var:1
Thread-1 Instance Var:1

Thread-0 Instance Var:1

Thread-1 Local Var:2
Thread-0 Local Var:2
Thread-1 Instance Var:2

Thread-0 Instance Var:2

Thread-1 Local Var:3
Thread-0 Local Var:3
Thread-1 Instance Var:3

Thread-0 Instance Var:3
*/
